home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-02-12 | 10.8 KB | 399 lines | [TEXT/MPS ] |
- ;
- ; File: StringCompare.a
- ;
- ; Contains: Public interfaces for String Comparison and related operations
- ;
- ; Version: Technology: Mac OS 8
- ; Release: Universal Interfaces 3.1
- ;
- ; Copyright: © 1985-1998 by Apple Computer, Inc., all rights reserved.
- ;
- ; Bugs?: Please include the the file and version information (from above) with
- ; the problem description. Developers belonging to one of the Apple
- ; developer programs can submit bug reports to:
- ;
- ; devsupport@apple.com
- ;
- ;
- IF &TYPE('__STRINGCOMPARE__') = 'UNDEFINED' THEN
- __STRINGCOMPARE__ SET 1
-
- IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
- include 'MacTypes.a'
- ENDIF
- IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
- include 'TextCommon.a'
- ENDIF
- IF &TYPE('__SCRIPT__') = 'UNDEFINED' THEN
- include 'Script.a'
- ENDIF
-
- ;
- ;
- ; Here are the current System 7 routine names and the translations to the older forms.
- ; Please use the newer forms in all new code and migrate the older names out of existing
- ; code as maintenance permits.
- ;
- ; NEW NAME OLD NAME OBSOLETE FORM (no handle)
- ;
- ; CompareString (Str255) IUCompPString (hp only) IUCompString (hp only)
- ; CompareText (ptr/len) IUMagPString IUMagString
- ; IdenticalString (Str255) IUEqualPString (hp only) IUEqualString (hp only)
- ; IdenticalText (ptr/len) IUMagIDPString IUMagIDString
- ; LanguageOrder IULangOrder
- ; ScriptOrder IUScriptOrder
- ; StringOrder (Str255) IUStringOrder (hp only)
- ; TextOrder (ptr/len) IUTextOrder
- ;
- ; RelString
- ; CmpString (a only)
- ; EqualString (hp only)
- ;
- ; ReplaceText
- ;
- ;
-
-
-
- ; Special language code values for Language Order
- systemCurLang EQU -2 ; current (itlbLang) lang for system script
- systemDefLang EQU -3 ; default (table) lang for system script
- currentCurLang EQU -4 ; current (itlbLang) lang for current script
- currentDefLang EQU -5 ; default lang for current script
- scriptCurLang EQU -6 ; current (itlbLang) lang for specified script
- scriptDefLang EQU -7 ; default language for a specified script
- ; obsolete names
-
- iuSystemCurLang EQU -2
- iuSystemDefLang EQU -3
- iuCurrentCurLang EQU -4
- iuCurrentDefLang EQU -5
- iuScriptCurLang EQU -6
- iuScriptDefLang EQU -7
-
-
- ; The following functions are old names, but are required for System 7 PowerPC builds
- ; because InterfaceLib exports these names, instead of the new ones.
-
-
-
- ;
- ; pascal short IUMagPString(const void *aPtr, const void *bPtr, short aLen, short bLen, Handle itl2Handle)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IUMagPString
- move.w #$001A,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IUMagPString
- ENDIF
-
- ;
- ; pascal short IUMagIDPString(const void *aPtr, const void *bPtr, short aLen, short bLen, Handle itl2Handle)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IUMagIDPString
- move.w #$001C,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IUMagIDPString
- ENDIF
-
- ;
- ; pascal short IUTextOrder(const void *aPtr, const void *bPtr, short aLen, short bLen, ScriptCode aScript, ScriptCode bScript, LangCode aLang, LangCode bLang)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IUTextOrder
- move.w #$0022,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IUTextOrder
- ENDIF
-
- ;
- ; pascal short IULangOrder(LangCode language1, LangCode language2)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IULangOrder
- move.w #$0020,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IULangOrder
- ENDIF
-
- ;
- ; pascal short IUScriptOrder(ScriptCode script1, ScriptCode script2)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IUScriptOrder
- move.w #$001E,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IUScriptOrder
- ENDIF
-
- ; The following are new names which are not exported by System 7 InterfaceLib for PowerPC.
- ;
- ; pascal short CompareText(const void *aPtr, const void *bPtr, short aLen, short bLen, Handle itl2Handle)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _CompareText
- move.w #$001A,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION CompareText
- ENDIF
-
- ;
- ; pascal short IdenticalText(const void *aPtr, const void *bPtr, short aLen, short bLen, Handle itl2Handle)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IdenticalText
- move.w #$001C,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IdenticalText
- ENDIF
-
- ;
- ; pascal short TextOrder(const void *aPtr, const void *bPtr, short aLen, short bLen, ScriptCode aScript, ScriptCode bScript, LangCode aLang, LangCode bLang)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _TextOrder
- move.w #$0022,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION TextOrder
- ENDIF
-
- ;
- ; pascal short LanguageOrder(LangCode language1, LangCode language2)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _LanguageOrder
- move.w #$0020,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LanguageOrder
- ENDIF
-
-
- ; The following new function name IS exported by InterfaceLib and works on both 68k and
- ; System 7 PowerPC.
-
-
- ;
- ; pascal short ScriptOrder(ScriptCode script1, ScriptCode script2)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _ScriptOrder
- move.w #$001E,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION ScriptOrder
- ENDIF
-
-
- ; The following new function name IS exported by InterfaceLib and works on both 68k and
- ; System 7 PowerPC.
-
-
- ;
- ; pascal short ReplaceText(Handle baseText, Handle substitutionText, Str15 key)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _ReplaceText
- move.l #$820CFFDC,-(sp)
- dc.w $A8B5
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION ReplaceText
- ENDIF
-
- ;
- ; pascal short IUMagString(const void *aPtr, const void *bPtr, short aLen, short bLen)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IUMagString
- move.w #$000A,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IUMagString
- ENDIF
-
- ;
- ; pascal short IUMagIDString(const void *aPtr, const void *bPtr, short aLen, short bLen)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IUMagIDString
- move.w #$000C,-(sp)
- dc.w $A9ED
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IUMagIDString
- ENDIF
-
- IF TARGET_CPU_68K THEN
- ;
- ; extern SInt32 RelString(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- ; parameters:
- ; textPtrA => A0
- ; textPtrB => A1
- ; lengthAB => D0
- ; returns:
- ; SInt32 <= D0
- _RelString: OPWORD $A050
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RelString
- ENDIF
-
- ;
- ; extern SInt32 RelStringMarks(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- ; parameters:
- ; textPtrA => A0
- ; textPtrB => A1
- ; lengthAB => D0
- ; returns:
- ; SInt32 <= D0
- _RelStringMarks: OPWORD $A250
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RelStringMarks
- ENDIF
-
- ;
- ; extern SInt32 RelStringCase(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- ; parameters:
- ; textPtrA => A0
- ; textPtrB => A1
- ; lengthAB => D0
- ; returns:
- ; SInt32 <= D0
- _RelStringCase: OPWORD $A450
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RelStringCase
- ENDIF
-
- ;
- ; extern SInt32 RelStringMarksCase(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- ; parameters:
- ; textPtrA => A0
- ; textPtrB => A1
- ; lengthAB => D0
- ; returns:
- ; SInt32 <= D0
- _RelStringMarksCase: OPWORD $A650
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RelStringMarksCase
- ENDIF
-
- ;
- ; extern UInt32 CmpString(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- ; parameters:
- ; textPtrA => A0
- ; textPtrB => A1
- ; lengthAB => D0
- ; returns:
- ; UInt32 <= D0
- _CmpString: OPWORD $A03C
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION CmpString
- ENDIF
-
- ;
- ; extern UInt32 CmpStringMarks(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- ; parameters:
- ; textPtrA => A0
- ; textPtrB => A1
- ; lengthAB => D0
- ; returns:
- ; UInt32 <= D0
- _CmpStringMarks: OPWORD $A23C
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION CmpStringMarks
- ENDIF
-
- ;
- ; extern UInt32 CmpStringCase(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- ; parameters:
- ; textPtrA => A0
- ; textPtrB => A1
- ; lengthAB => D0
- ; returns:
- ; UInt32 <= D0
- _CmpStringCase: OPWORD $A43C
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION CmpStringCase
- ENDIF
-
- ;
- ; extern UInt32 CmpStringMarksCase(BytePtr textPtrA, BytePtr textPtrB, UInt32 lengthAB)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- ; parameters:
- ; textPtrA => A0
- ; textPtrB => A1
- ; lengthAB => D0
- ; returns:
- ; UInt32 <= D0
- _CmpStringMarksCase: OPWORD $A63C
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION CmpStringMarksCase
- ENDIF
-
- ELSE
- ;
- ; pascal short RelString(ConstStr255Param str1, ConstStr255Param str2, Boolean caseSensitive, Boolean diacSensitive)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RelString
- ENDIF
-
- ;
- ; pascal Boolean EqualString(ConstStr255Param str1, ConstStr255Param str2, Boolean caseSensitive, Boolean diacSensitive)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION EqualString
- ENDIF
-
- ENDIF ; TARGET_CPU_68K
- ENDIF ; __STRINGCOMPARE__
-
-